package com.finance.report.controller;

import com.finance.framework.controller.BaseController;
import com.finance.framework.controller.Result;
import com.finance.framework.lang.Page;
import com.finance.framework.lang.PageResultBO;
import com.finance.report.bean.pojo.NoCalculationInfo;
import com.finance.report.bean.pojo.NoCalculationInfoList;
import com.finance.report.request.NoCalculationListReq;
import com.finance.report.service.INoCalculationService;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;

/**
 * @Author: gly
 * @Date: Created in 2017-08-22
 */
@Component
@RequestMapping("/report/nocalculation")
public class NoCalculationController extends BaseController {
    @Resource
    private INoCalculationService noCalculationService;

    @RequestMapping("/index.htm")
    public String index(){
        return "report/nocalculation/index";
    }

    @RequestMapping("/list")
    public Result list(NoCalculationListReq form){
        Page page =Page.getInstance(form);
        NoCalculationInfoList list = new NoCalculationInfoList();
        list.setWorkNo(form.getWorkNo());
        list.setUserName(form.getUserName());
        list.setOrgName(form.getOrgName());
        list.setSupplierName(form.getSupplierName());
        list.setCarrierName(form.getCarrierName());
        list.setToProvince(form.getToProvince());
        list.setSuffix(form.getSuffix());
        page.setParams(list);
        PageResultBO<NoCalculationInfo> resultBO = noCalculationService.listByPage(page);
        return getSuccessResult(resultBO);
    }
}
